package com.wonder.common.exception;


public enum ExceptionCodeEnum implements ExceptionHandler{
    // 数据操作错误定义
    SUCCESS(200, "操作成功","system.success",true),
    FAILED(501, "操作失败", "system.fail",false),
    PRAM_NOT_MATCH(400, "参数不正确", "system.system.parameterError",false),
    VALIDATE_FAILED(400, "参数检验失败", "system.validateFailed",false),
    UNAUTHORIZED(401, "未登录或token过期，请登录！","system.unauthorized",false),
    FORBIDDEN(403, "没有相关权限", "system.forbidden",false),
    NOT_FOUND(404, "没有找到相关数据", "system.notFound",false),
    ERROR(500, "系统异常", "system.exception",false),
    ;

    private long code;
    private String message;
    private String msgId;
    private Boolean res;

    private ExceptionCodeEnum(long code, String message,Boolean res){
        this.code = code;
        this.message = message;
        this.res = res;
    }
    private ExceptionCodeEnum(long code, String message,String msgId,Boolean res){
        this.code = code;
        this.message = message;
        this.msgId = msgId;
        this.res = res;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
    @Override
	public String getMsgId() {
		return msgId;
	}

	@Override
    public Boolean getRes(){
        return res;
    }
}
